#include<iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <set>
#include <map>
using namespace std;
class Solution {
public:
    string countAndSay(int n) {
        string s = "1",ss;
        while (--n)
        {
            char t = ' ';
            int it = 0;
            ss = "";
            for (int i = 0; i < s.length(); i++)
            {
                char c = s[i];
                if (c == t)it++;
                else
                {
                    if (it)
                    {
                        ss += to_string(it);
                        ss += t;
                    }
                    it = 1;
                    t = c;
                }
            }
            if (it)
            {
                ss += to_string(it);
                ss += t;
            }
            s = ss;
            
        }
        return s;
    }
};
int main()
{
    Solution sol;
    cout << sol.countAndSay(2) << endl;
}